package com.dingreading.cloud.mall.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.mybatisflex.annotation.RelationOneToMany;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

@Data
public class CouponStaffDto implements Serializable {

    private Long id;

    /**
     * 添加时间
     */
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date addTime;

    private Long couponId;

    private Double couponMoney;

    private String couponName;

    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date editTime;

    /**
     * 商品状态 1.启用 0.禁用
     */
    private Integer enabled;

    private Long staffId;

    private Long typeId;

    private String typeName;

    private Double usedMoney;

    private String staffUid;

    private String storeUid;

    private String fullName;

    private String storeName;

    private Double usableMoney;

    private Double conformMoney;

    private String remark;

    private String goodsIds;

    private String goodsCategoryIds;

    @RelationOneToMany(
            selfField = "goodsIds",
            selfValueSplitBy = ",", //使用 "," 对值进行分割
            targetTable = "goods", //只获取某个字段值需要填入目标表名
            targetField = "id",
            valueField = "name"
    )
    private List<String> goodsList;

    @RelationOneToMany(
            selfField = "goodsCategoryIds",
            selfValueSplitBy = ",", //使用 "," 对值进行分割
            targetTable = "goods_category", //只获取某个字段值需要填入目标表名
            targetField = "id",
            valueField = "name"
    )
    private List<String> goodsCategoryList;

}
